package com.lkm.market2_0;


import com.lkm.market2_0.entity.OrganizationInfo;
import com.lkm.market2_0.netapi.Api;

import java.util.HashMap;
import java.util.Map;




public class AppDataCache {

    private static AppDataCache instance=new AppDataCache();
    public static AppDataCache getInstance() {
        return instance;
    }


    private String pushKey="";

    public synchronized String getPushKey() {
        return pushKey;
    }

    public synchronized void setPushKey(String pushKey) {
        this.pushKey = pushKey;
    }

    public String getDeviceMac(){
        return Api.deviceMac;
    };


    private Map<Integer,OrganizationInfo> organizationEntityMap= new HashMap<>();


    

    public OrganizationInfo getOrganizationEntity(int id) {
        return organizationEntityMap.get(id);
    }

    public void setOrganizationEntity(Map<Integer,OrganizationInfo> organizationEntity) {
        this.organizationEntityMap = organizationEntity;
    }
    public void put(OrganizationInfo organizationEntity) {
        if(this.organizationEntityMap!=null)
        this.organizationEntityMap.put(organizationEntity.getId(), organizationEntity);
    }
}
